package ControlLayer;
import ModelLayer.*;

/**
 * Write a description of class LoansHandler here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class LoansHandler
{
    private PersonHandler people;
    private DVDHandler dvds;
    private LoanContainer loans;
    private Loan loan;
    /**
     * Constructor for objects of class LoansHandler
     */
    public LoansHandler()
    {
        people = new PersonHandler();
        dvds = new DVDHandler();
        loans = LoanContainer.getInstance();
    }
    
    public boolean createLoan(Loan loan)
    {
        //loan = new Loan(id,borrowDate,period,people.findPerson(personid),copy);
        return loans.addLoan(loan);
    }
     
    public Loan findLoan(int id)
    {
        return loans.findLoan(id);
    }
    
    public void deleteLoan(int id)
    {
        loans.deleteLoan(findLoan(id));
    }
}
